package com.qf.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/10/12 16:59
 */
@RequestMapping("/test")
@RestController
//动态刷新配置,原理,生成该类对象时会在缓存生成一个代理对象,配置变更，代理对象发生变更,该类调用代理对象就会自动刷新
@RefreshScope
public class TestController {
//    获取码云配置中心里面的值
    @Value("${version}")
    private String version;

    @RequestMapping("/test1")
    public String hello(){
        return version;
    }
}
